package aca

class Verifica {
	
	public static boolean verificaProf(String user){
		List<String> professores = new ArrayList<String>();
		for (int i=1; i <= Professor.count(); i++){
			professores.add(Professor.get(i).getEmail().toString())
		}
		if (professores.contains(this.trataParametro(user))){
			return true;
		}
		return false;
	}
	
	public static boolean verificaAdm(String user){
		List<String> adms = new ArrayList<String>();
		for (int i=1; i <= Administrador.count(); i++){
			adms.add(Administrador.get(i).getEmail().toString())
		}
		if (adms.contains(this.trataParametro(user))){
			return true;
		}
		return false;
	}
	
	public static Aluno retornaAluno(String email){
		//List<String> adms = new ArrayList<String>();
		String emailF = trataParametro(email);
		for (int i=1; i <= Aluno.count(); i++){
			if (Aluno.get(i).getEmail().equals(emailF))
			return Aluno.get(i)
		}
	}
	
	public static String trataParametro(String[] parametro){
		return parametro[0].substring(1, parametro[0].length()-1)
	}
	
	public static String trataParametro(String parametro){
		return parametro.substring(1, parametro.length()-1)
	}
	

}
